//
//  FocusCircleViewController.m
//  DefendHealth
//
//  Created by 吾诺翰卓003 on 17/2/18.
//  Copyright © 2017年 iMacOne. All rights reserved.
//

#import "FocusCircleViewController.h"
#import "HotCircleTableViewCell.h"
@interface FocusCircleViewController ()

@end

@implementation FocusCircleViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.Nav.hidden = YES;
    self.baseTableView.frame = CGRectMake(0, 0, WindowWidth, WindowHeight-64-49);
//    self.baseTableView.backgroundColor = [UIColor whiteColor];
//    self.view.backgroundColor = [UIColor whiteColor];
    [self addHeadView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)addHeadView{
    UIView *headView1 = [UIView new];
    
    headView1.backgroundColor = [UIColor whiteColor];
    
    
    UILabel *lab1 = [UILabel new];
    lab1.frame = CGRectMake(10, 0, 118, 44);
    lab1.text = @"我的圈子";
    lab1.font = FONT(13);
    lab1.textColor = UIColorFromRGB(0x333333);
    lab1.textAlignment = 0;
    [headView1 addSubview:lab1];
    
    NSArray *titleArr = @[@"杭州西湖跑大联盟",@"绿城高尔夫大叔团"];
    
    for (int i = 0 ; i<titleArr.count; i++) {
        BaseView *view = [BaseView new];
        view.backgroundColor = [UIColor whiteColor];
        view.frame = CGRectMake(0, kMaxY(lab1.frame)+i*44, WindowWidth, 44);
        [headView1 addSubview:view];
        
        UIImageView *img = [UIImageView new];
        img.frame = CGRectMake(10, 13.5, 17, 17);
        img.backgroundColor = [UIColor grayColor];
        [view addSubview:img];
        
        UILabel *lab2 = [UILabel new];
        lab2.frame = CGRectMake(kMaxX(img.frame)+12, 0, WindowWidth, 44);
        lab2.text = titleArr[i];
        lab2.font = FONT(13);
        lab2.textColor = UIColorFromRGB(0x333333);
        lab2.textAlignment = 0;
        [view addSubview:lab2];
        
        UILabel *lab3 = [UILabel new];
        lab3.frame = CGRectMake(WindowWidth-10-200, 0, 200, 44);
        lab3.text = @"99+ >";
        lab3.font = FONT(13);
        lab3.textColor = UIColorFromRGB(0x333333);
        lab3.textAlignment = 2;
        [view addSubview:lab3];
        
    }
    
    headView1.frame = CGRectMake(0, 0,WindowWidth , kMaxY(lab1.frame)+88+24);
    self.baseTableView.tableHeaderView = headView1;
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 2;
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 226;
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString * cellIden = @"HotCircleTableViewCell";
    HotCircleTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIden];
    if (cell == nil) {
        cell = [[HotCircleTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIden];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    cell.backgroundColor = [UIColor whiteColor];
    return cell;
}
@end
